import http from '@/utils/http.js';

// 获取文件列表
export function getFileList(params) {
  return http({
    url: '/file/file_list',
    method: 'get',
    params
  });
}

// 搜索文件
export function searchFile(params) {
  return http({
    url: '/file/file_search',
    method: 'get',
    params
  });
}

// 添加文件
export function addFile(data) {
  return http({
    url: '/file/file_save',
    method: 'post',
    data
  });
}

// 删除文件
export function deleteFile(data) {
  return http({
    url: '/file/file_del',
    method: 'post',
    data
  });
}

// 彻底删除文件
export function deleteFileLog(data) {
  return http({
    url: '/file/file_log_del',
    method: 'post',
    data
  });
}

// 恢复删除文件
export function recoverFile(data) {
  return http({
    url: '/file/file_back',
    method: 'post',
    data
  });
}

// 添加目录
export function addFolder(data) {
  return http({
    url: '/file/folder_save',
    method: 'post',
    data
  });
}

// 删除目录
export function deleteFolder(data) {
  return http({
    url: '/file/folder_del',
    method: 'post',
    data
  });
}

// 彻底删除目录
export function deleteFolderLog(data) {
  return http({
    url: '/file/folder_log_del',
    method: 'post',
    data
  });
}

// 恢复删除目录
export function recoverFolder(data) {
  return http({
    url: '/file/folder_back',
    method: 'post',
    data
  });
}

// 获取分享列表
export function getShareList(params) {
  return http({
    url: '/share/share_list',
    method: 'get',
    params
  });
}

// 添加分享
export function addShare(data) {
  return http({
    url: '/share/share_save',
    method: 'post',
    data
  });
}

// 删除分享
export function deleteShare(data) {
  return http({
    url: '/share/share_del',
    method: 'post',
    data
  });
}

// 回收站列表
export function delFileList(params) {
  return http({
    url: '/file/file_del_list',
    method: 'get',
    params
  });
}
// 分享详情
export function shareFile(params) {
  return http({
    url: '/share/share_info',
    method: 'get',
    params
  });
}
// 分享文件详情
export function shareFileDetail(params) {
  return http({
    url: '/share/file_info',
    method: 'get',
    params
  });
}
// 恢复文件
export function recoveryFile(data) {
  return http({
    url: '/file/file_back',
    method: 'post',
    data
  });
}
// 恢复文件夹
export function recoveryFolder(data) {
  return http({
    url: '/file/folder_back',
    method: 'post',
    data
  });
}

export function downloadPoints(data) {
  return http({
    url: '/share/down_log',
    method: 'post',
    data
  });
}
